"""
提示词连接示例
"""
from langchain_core.messages import AIMessage, HumanMessage, SystemMessage
from langchain_core.prompts import PromptTemplate

# 通过+号连接多个prompt
prompt = (
    PromptTemplate.from_template("tell me joke about {topic}")
    +", make it funny"
    +"\n and in {language}"
)
print(prompt.format(topic="python", language="english"))

# 聊天提示词连接
prompt1 = SystemMessage(content="You are a nice pirate")
new_prompt = (
        prompt1 + HumanMessage(content="hi") + AIMessage(content="what?") + "{input}"
)
print(new_prompt.format( input="how are you?"))

